import request from '@/utils/request'
// 登录后合并购物车
export const mergeLocalCart = (cartList) => {
  return request('/member/cart/merge', 'post', cartList)
}
// 获取购物车商品
export const findCartList = () => {
  return request('/member/cart', 'get')
}
// 登录后加入购物车
export const insertCart = ({ skuId, count }) => {
  return request('/member/cart', 'post', { skuId, count })
}
// 删除商品 ids传入商品skuId
export const deleteCart = (ids) => {
  return request('/member/cart', 'delete', { ids })
}
// 修改购物车商品状态和数量 goods:goods.skuId - 商品sku  goods.selected - 选中状态 goods.count - 商品数量
export const updateCart = (goods) => {
  return request('/member/cart/' + goods.skuId, 'put', goods)
}
// 全选和取消全选 ids传入商品skuId
export const checkAllCart = ({ selected, ids }) => {
  return request('/member/cart/selected', 'put', { selected, ids })
}